<template>
  <div class="common-layout">
    <el-container>
      <el-aside width="200px">
        <el-menu
            default-active="2"
            :router="true"
        >
          <el-menu-item index="1" route="/teacher/teaMain"  >
            <template #title>
              <el-icon><House /></el-icon>
              <span>首页</span>
            </template>
          </el-menu-item>
          <el-menu-item index="2" route="/teacher/studentManage" >
            <template #title>
              <el-icon><Tools /></el-icon>
              <span>学生信息管理</span>
            </template>
          </el-menu-item>

<!--          <el-menu-item index="3"  route="/teacher/learningMonitoring">-->
<!--            <template #title>-->
<!--              <el-icon><Avatar /></el-icon>-->
<!--              <span>学生学习监控</span>-->
<!--            </template>-->
<!--&lt;!&ndash;            <el-menu-item-group >&ndash;&gt;-->
<!--&lt;!&ndash;              <el-menu-item v-for="item in className"  index="'/teacher/learningMonitoring'+item">{{ item  }}</el-menu-item>&ndash;&gt;-->
<!--&lt;!&ndash;&lt;!&ndash;              <el-menu-item index="3-2">item two</el-menu-item>&ndash;&gt;&ndash;&gt;-->
<!--&lt;!&ndash;            </el-menu-item-group>&ndash;&gt;-->
<!--          </el-menu-item>-->
          <el-menu-item index="4" route="/teacher/teaAnswering"  >
            <template #title>
              <el-icon><Service /></el-icon>
              <span>答疑模块</span>
            </template>
          </el-menu-item>
          <el-menu-item index="5" route="/teacher/teaCourse" >
            <template #title>
              <el-icon><Menu /></el-icon>
              <span>课程编辑模块</span>
            </template>
          </el-menu-item>
<!--          <el-menu-item index="6" route="/teacher/classesManager" >-->
<!--            <template #title>-->
<!--              <el-icon><Sunset /></el-icon>-->
<!--              <span>班级管理模块</span>-->
<!--            </template>-->
<!--          </el-menu-item>-->

        </el-menu>
      </el-aside>
      <el-container>
        <el-header style="text-align: right; background-color: rgb(236,245,255); font-size: 12px">

          <el-dropdown style="margin-top: 20px;margin-right: 15px;">
			    <span class="el-dropdown-link">
			      欢迎登录
			      <el-icon class="el-icon--right">
              <arrow-down />
			      </el-icon>
			    </span>
            <template #dropdown>
              <el-dropdown-menu>
                <el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
              </el-dropdown-menu>
            </template>
          </el-dropdown>
        </el-header>
        <el-main><router-view></router-view></el-main>

      </el-container>
    </el-container>
  </div>
</template>

<script>
import {useLoginStateStore} from "../store/storeLoginState.js";

export default {
  name: "Teacher",
  setup(){
    const loginStateStore = useLoginStateStore()
    return {
      loginStateStore: loginStateStore,

    }
  },
  data(){
    return{
      className:[],
    }

  },
  mounted() {
   // this.get();


  },

  methods: {
    //加载班级数据
    // get(){
    //   let _this=this;
    //   let teaNum=_this.loginStateStore.loginUserName
    //   let url="/studyadmin/class/classList";
    //   _this.$axios.post(url).then(function (serverData) {
    //     let s=serverData.data.data
    //         if(serverData.data.code===0){
    //           for(let i=0;i<s.length;i++){
    //             console.log("-------------",s[i].claName)
    //             _this.className.push(s[i].claName)
    //           }
    //           console.log(_this.className)
    //
    //         }
    //   })
    //
    // },
    logout() {
      this.$confirm('您确定要退出登录吗?', '提示', {
        confirmButtonText: 'sure',  //确认按钮的文字显示
        type: 'warning',
        center: true, //文字居中显示
      })
          .then(() => {
            this.$message({
              type: 'success',
              message: '退出登录成功'
            })
            this.$router.push("/")
            sessionStorage.clear()
          })
          .catch(() => {
            this.$message({
              type: 'info',
              message: '已取消退出登录'
            })
          })

    },
  }
}
</script>

<style scoped>

</style>
